<template>
  <div class="research1">
      <h1 v-if="title != ''" class="title">
          <span>{{title}}</span>
          <!-- <span>查看更多 ></span> -->
      </h1>
      <div>
          <ul>
              <li class="newsdetail" v-for="(item,index) in newslist" :key="index">
                  <img :src="item.thumbnail" alt="">
                  <div class="newsinfo">
                      <nuxt-link :to="'/post/' + item.pid"><h1>{{item.name}}</h1></nuxt-link>
                      <h2>{{item.summary}}</h2>
                      <p>
                          <span><i class="el-icon-time"></i>{{item.createtime.slice(0,11)}}</span>
                          <span><i class="el-icon-view"></i>阅读：{{item.readNum}}</span>
                          <span><i class="el-icon-news"></i> <nuxt-link :to="'/newslist/' + item.tagName.pinyin">{{item.tagName.name}}</nuxt-link></span>
                      </p>
                  </div>
              </li>
          </ul>
      </div>
  </div>
</template>


<script>
export default {
  props: {
    newslist:{
      type:Array,
      default:function(){
        return []
      }
    },
    title:{
      type:String,
      default:"财经头条"
    }
  }

};
</script>

<style scoped>
.research1{ 
    width: 100%;
    height: 1554px;
    margin-top: 10px;
    overflow: hidden;
    background: white;
    padding: 0 20px;
    box-sizing: border-box;
}
.title{
    padding: 20px 0 10px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ccc;
}
.title span:nth-child(1){
    color: #cd9c54;
    font-size: 22px;
}
.title span:nth-child(2){
    color: #666;
    font-size: 14px;
}
.newsdetail{
    height: 200px;
    width: 100%;   
    margin: 20px 0;
}
.newsdetail img{
    float: left;
    height: 200px;
    width: 300px;
}
.newsdetail .newsinfo{
    float: left;
    width: 420px;
    height: 200px;
    margin-left: 30px;
}
.newsinfo h1{
    color: #333;
    font-weight: bolder;
    font-size: 16px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 50px;
}
.newsinfo h2{
    color: #666;
    font-size: 14px;
    margin-top: 16px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 38px;
}
.newsinfo p{
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
}
.newsinfo p i{
    margin-right: 10px;
}
</style>

